<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<link href="assets/css/bootstrap-select.css" rel="stylesheet"/>
<link href="assets/css/modify.css" rel="stylesheet"/>
<script src="assets/js/select2/select2.js"></script>
<link href='assets/css/fullcalendar/fullcalendar.css' rel='stylesheet'/>
<script src='assets/js/fullcalendar/fullcalendar.js'></script>
<style>
	.modal-header {
		background-color: #E9F5FF !important;
		color: #8dafc9 !important;
	}

	.modal-title {
		font-size: 16px !important;
	}

	.bootbox-expand-button {
		width: 19px;
		height: 19px;
		border: none;
		cursor: pointer;
		-webkit-appearance: none;
		float: right;
		top: -18px;
		left: -30px;
		position: relative;
		background: #E9F5FF url("assets/img/nav-img/icon_window.png") no-repeat 0 0;
	}

	.bootbox-close-button {
		width: 19px;
		height: 19px;
		border: none;
		cursor: pointer;
		-webkit-appearance: none;
		float: right;
		top: 4px;
		left: -5px;
		position: relative;
		background: #E9F5FF url("assets/img/nav-img/icon_close.png") no-repeat 0 0;
	}

	.bootbox .modal-dialog {
		width: 60% !important;
	}

	.modal-content {
		width: 100%;
	}

	.expandView {
		width: 100%;
	}
</style>
<div class="row" style="margin-left: 0px!important;">
	<#list listMap as data>
		<!-- 映射列表 -->
		<div class="col-xs-12 margin-top-20">
			<a type="btn" class="btn basicInfoBtnt"
			   style="background-color: #23a8f5;border: none;border-top-left-radius: 4px!important;border-bottom-left-radius: 4px!important;width: 120px;color: #fff;margin-right: 0!important;box-shadow:0px 0px 10px rgba(122,161,184,0.3);">
				班级信息
			</a><a type="btn" class="btn basicInfoBtnt"
				   style="border: none;border-top-right-radius: 4px!important;border-bottom-right-radius: 4px!important;width: 120px;color: #4a647d;box-shadow:0px 0px 10px rgba(122,161,184,0.3);">变更记录
		</a>
		</div>

		<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
			<div class="widget flat radius-bordered nomargin-bottom">
				<div class="widget-body no-padding">
					<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"
						 style="border: 1px solid #8dafc9;height: 40px;background-color: #fff;line-height: 40px">
						<label> 信息详情:</label>
					</div>
					<div class="table-scrollable modelClassChangeShow" style="border: 1px solid #8dafc9;border-top: none;">
						<!-- 数据表列信息列表 -->
						<table class="table table-hover dataTable newtable">
							<thead>
							<tr>
								<th title="课程起止日期">课程起止日期</th>
								<th title="上课时间">上课时间</th>
								<th title="周几上课">周几上课</th>
								<th title="上课教室">上课教室</th>
								<th title="课程节数">课程节数</th>
								<th title="剩余节数">剩余节数</th>
								<th title="耗课时数">耗课时数</th>
								<th title="创建人">创建人</th>
								<th title="创建日期">创建日期</th>
							</tr>
							</thead>
							<tbody >
							<tr>
								<td>${data.startDate}</td>
								<td>${data.startTime}-${data.endTime}</td>
								<td>周二/周四</td>
								<td>CLASSA</td>
								<td>12</td>
								<td>5</td>
								<td>3</td>
								<td>王华华</td>
								<td>2017.03.01</td>
							</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
		<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
			<div class="widget flat radius-bordered">
				<div class="widget-body no-padding">
					<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"
						 style="height: 40px;background-color: #FFB46A;line-height: 40px">
						<label> 课程明细:</label>
					</div>
					<div class="table-scrollable modelClassChangeShow" style="border: 1px solid #8dafc9;border-top: none;">
						<!-- 数据表列信息列表 -->
						<table class="table table-hover dataTable newtable">
							<thead>
							<tr>
								<th title="选择" class="checkboxColumnTh">
									<div class="checkbox">
										<label>
											<input type="checkbox" class="chkAll">
											<span class="text"></span>
										</label>
									</div>
								</th>
								<th title="课程周次">课程周次</th>
								<th title="上课时间">上课日期</th>
								<th title="上课时间">上课时间</th>
								<th title="周几上课">周几上课</th>
								<th title="授课老师">授课老师</th>
								<th title="上课教室">上课教室</th>
								<th title="耗课时数">耗课时数</th>

							</tr>
							</thead>
							<tbody id="classChangeTbody">
							<#list data["lessonsList"] as cl>
								<tr>
									<td class="checkboxColumnTd">
										<div class="checkbox">
											<label>
												<input type="checkbox" class="chk" name="id" value="${cl.id}">
												<span class="text"></span>
											</label>
										</div>
									</td>
									<td></td>
									<td>${cl.classTime} </td>
									<td>${data.startTime}-${data.endTime}</td>
									<td><@dictionary groupCode="weekDay" dictionaryCode="${data.weekDay}" ;weekDay>${weekDay.value }</@dictionary></td>
									<td>${cl.adminUserId}</td>
									<td>${cl.classId}</td>
									<td>${data.pitchNumber}</td>

								</tr>
							</#list>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</#list>
</div>
<script>
    $(".selectpicker").select2();
    var date = new Date();
    var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();
    function expandView() {
        $(".modal-dialog").toggleClass("expandView");
        $(".modal-content").toggleClass("expandView");
        $(".bootboxs").toggleClass("bootbox");
    }

    function showOrHidden(that) {
        $(".modelClassChangeShow").toggleClass("hidden");
    }

    //    课程变动判断
    function classChangeSingular() {
        var num = 0;
        var indexArr = [];
        $("#classChangeTbody").find(".chk").each(function () {
            if ($(this).prop("checked")) {
                var index = $(this).parents(".checkboxColumnTd").parent().index();
                indexArr.push(index);
                num++;
            }
        })
        if (num == 0) {
            $("#classChangeSingular").addClass("hidden");
            $("#classChangeSingular").empty();
            return;
        }
        if (num == 1) {
            $("#classChangeSingular").empty();
            $("#classChangeSingular").removeClass("hidden");
            $("#classChangeSingular").append('<label class="classChangeDiv">变动上课日期：变动时间：变动教室：变动老师：</label>')
        }
        if(num>1){
            $("#classChangeSingular").addClass("hidden");
            $("#classChangeSingular").empty();
            console.log(indexArr)
            $("#calendar").show();
            $(".fc-button-today").click();
            $('#calendar').fullCalendar({
                // 头部信息
                header: {
                    left: 'prevYear,nextYear',
                    center: 'title',
                    right: 'today prev,next'
                },
                handleWindowResize: false,
            });
        }

    }

    //    课程停课
    function classChangeSuspend() {
        var num = 0;
        var indexArr = [];
        $("#classChangeTbody").find(".chk").each(function () {
            if ($(this).prop("checked")) {
                var index = $(this).parents(".checkboxColumnTd").parent().index();
                indexArr.push(index);
                num++;
            }
        });
        if (num == 0) {
            $("#classChangeSingular").empty();
            $("#classChangeSingular").addClass("hidden");
            return;
        }
        if (num == 1) {
            $("#classChangeSingular").empty();
            $("#classChangeSingular").removeClass("hidden");
            $("#classChangeSingular").append('<label class="classChangeDiv">瑞宝爱阅读 2017.04.29 ，2017.04.30 ，2017.04.50 即将进行课程操作</label>');

        }
        if(num>1){
            $("#classChangeSingular").addClass("hidden");
            $("#classChangeSingular").empty();
            console.log(indexArr)

        }
    }
</script>
<script src="assets/js/validation/bootstrapValidator_init.js"></script>
